package com.atguigu.spzx.manager.controller.product;

import com.atguigu.spzx.manager.service.product.ProductUnitService;
import com.atguigu.spzx.model.entity.product.ProductUnit;
import com.atguigu.spzx.model.vo.common.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Tag(name = "商品单位管理模块")
@RequestMapping("/admin/product/productUnit")
public class ProductUnitController {
    @Resource
    ProductUnitService productUnitService;
    @Operation(summary = "查询所有商品单位")
    @GetMapping("/findAll")
    public Result findAll(){
        List<ProductUnit> list =  productUnitService.findAll();
        return Result.ok().data(list);
    }
}
